﻿<%@ Page Language="C#" MasterPageFile="~/teachers/masterpage.Master" AutoEventWireup="true" CodeBehind="TAttendence.aspx.cs" Inherits="ESCHOOL.teachers.WebForm4" Title="Attendence" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">

    .style3
    {
        width: 70%;
    }
        .style3
        {
            width: 100%;
        }
        .style8
        {
            width: 100%;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" runat="server" 
    contentplaceholderid="ContentPlaceHolder1">
    <p>
        <br />
    </p>
    <asp:Panel ID="Panel3" runat="server">
        <p>
            <br />
        </p>
        <p>
        </p>
        <asp:Panel ID="Panel1" runat="server">
            <table class="style3">
                <tr>
                    <td>
                        &nbsp;</td>
                    <td colspan="2">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td colspan="2">
                        <asp:TextBox ID="tbdayid" runat="server" Visible="False"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Date</td>
                    <td colspan="2">
                        <asp:TextBox ID="tbdate" runat="server" ReadOnly="True"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Class</td>
                    <td colspan="2">
                        <asp:TextBox ID="tbclass" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Student</td>
                    <td colspan="2">
                        <asp:DropDownList ID="ddstud" runat="server" AutoPostBack="True">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        Attendence</td>
                    <td colspan="2">
                        <asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="True" 
                        onselectedindexchanged="RadioButtonList1_SelectedIndexChanged">
                            <asp:ListItem Value="p">P</asp:ListItem>
                            <asp:ListItem Value="a">A</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="labreason" runat="server" Text="Reason"></asp:Label>
                    </td>
                    <td colspan="2">
                        <asp:TextBox ID="tbreason" runat="server" TextMode="MultiLine">No</asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                        ControlToValidate="tbreason" ErrorMessage="fill it"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lableave" runat="server" Text="Leave"></asp:Label>
                    </td>
                    <td colspan="2">
                        <asp:RadioButtonList ID="RadioButtonList2" runat="server" 
                        onselectedindexchanged="RadioButtonList2_SelectedIndexChanged">
                            <asp:ListItem Value="True">Yes</asp:ListItem>
                            <asp:ListItem Value="False">No</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Button ID="btninsert" runat="server" onclick="btninsert_Click" 
                        Text="Insert" />
                    </td>
                    <td>
                        <asp:Button ID="btnupdate" runat="server" onclick="btnupdate_Click" 
                        Text="Update" />
                    </td>
                    <td>
                        &nbsp;</td>
                </tr>
            </table>
        </asp:Panel>
        <p>
        </p>
        <p>
            List of absent(leave)</p>
        <asp:GridView ID="GridView1" runat="server" 
            onselectedindexchanged="GridView1_SelectedIndexChanged" 
            AutoGenerateColumns="False" 
            onpageindexchanging="GridView1_PageIndexChanging" AllowPaging="True" 
        onrowdeleting="GridView1_RowDeleting" 
    onrowediting="GridView1_RowEditing">
            <Columns>
                <asp:BoundField DataField="student_name" HeaderText="Student Name" />
                <asp:TemplateField HeaderText="Date">
                    <ItemTemplate>
                        <%#Eval("date","{0:d}") %>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="attendence" HeaderText="Attendence" />
                <asp:BoundField DataField="reason" HeaderText="Reason" />
                <asp:BoundField DataField="leave" HeaderText="Leave" />
                <asp:TemplateField HeaderText="Edit">
                    <ItemTemplate>
                        <asp:Button ID="btnedit" runat="server" 
                            CommandArgument='<%# Eval("day_id") %>' Text="Edit" 
                            CausesValidation="False" CommandName="Edit" oncommand="btnedit_Command" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Delete">
                    <ItemTemplate>
                        <asp:Button ID="btndelete" runat="server" 
                            CommandArgument='<%# Eval("day_id") %>' Text="Delete" 
                            CausesValidation="False" CommandName="Delete" 
                            oncommand="btndelete_Command" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <p>
        </p>
        <p>
        </p>
        <asp:Panel ID="Panel2" runat="server">
            List of present
            <asp:GridView ID="GridView2" runat="server" 
    AutoGenerateColumns="False" AllowPaging="True" 
            onpageindexchanging="GridView2_PageIndexChanging" 
            onrowdeleting="GridView2_RowDeleting" onrowediting="GridView2_RowEditing">
                <Columns>
                    <asp:BoundField DataField="student_name" 
            HeaderText="Student Name" />
                    <asp:TemplateField HeaderText="Date">
                        <ItemTemplate>
                            <%#Eval("date","{0:d}") %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="attendence" 
            HeaderText="Attendence" />
                    <asp:TemplateField HeaderText="Edit">
                        <ItemTemplate>
                            <asp:Button ID="btneditp" runat="server" 
                            CommandArgument='<%# Eval("day_id") %>' CommandName="Edit" 
                            oncommand="btneditp_Command" Text="Edit" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Delete">
                        <ItemTemplate>
                            <asp:Button ID="btndeletep" runat="server" 
                            CommandArgument='<%# Eval("day_id") %>' CommandName="Delete" 
                            oncommand="btndeletep_Command" Text="Delete" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </asp:Panel>
        <p>
            &nbsp;</p>
        <p>
            List of absent(not leave)</p>
        <p>
            <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" 
            AllowPaging="True" onpageindexchanging="GridView3_PageIndexChanging" 
            onrowdeleting="GridView3_RowDeleting" onrowediting="GridView3_RowEditing">
                <Columns>
                    <asp:BoundField DataField="student_name" HeaderText="Student Name" />
                    <asp:TemplateField HeaderText="Date">
                        <ItemTemplate>
                            <%#Eval("date","{0:d}") %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="attendence" 
                    HeaderText="Attendence" />
                    <asp:BoundField DataField="reason" HeaderText="Reason" />
                    <asp:TemplateField HeaderText="Edit">
                        <ItemTemplate>
                            <asp:Button ID="btnedit0" runat="server" CommandArgument='<%# Eval("day_id") %>' 
                            CommandName="Edit" oncommand="btnedit_Command1" Text="Edit" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Delete">
                        <ItemTemplate>
                            <asp:Button ID="btndelete0" runat="server" 
                            CommandArgument='<%# Eval("day_id") %>' CommandName="Delete" 
                            oncommand="btndelete_Command1" Text="Delete" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </p>
    </asp:Panel>
    <p>
    </p>
    <asp:Panel ID="Panel4" runat="server">
        <table class="style8">
            <tr>
                <td>
                    Select class<asp:DropDownList ID="ddclasses" runat="server" 
                        onselectedindexchanged="ddclasses_SelectedIndexChanged" 
                        AutoPostBack="True">
                    </asp:DropDownList>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label1" runat="server" Text="Present" Visible="False"></asp:Label>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    <asp:GridView ID="GridView4" runat="server" AutoGenerateColumns="False">
                        <Columns>
                            <asp:BoundField DataField="student_name" HeaderText="Student Name" />
                            <asp:TemplateField HeaderText="Date">
                            <ItemTemplate>
                            <%#Eval("date","{0:d}") %></ItemTemplate></asp:TemplateField>
                           
                        </Columns>
                    </asp:GridView>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label2" runat="server" Text="Absent(leave)" Visible="False"></asp:Label>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    <asp:GridView ID="GridView5" runat="server" AutoGenerateColumns="False">
                        <Columns>
                            <asp:BoundField DataField="student_name" HeaderText="Student Name" />
                            <asp:TemplateField HeaderText="Date">
                            <ItemTemplate>
                            <%#Eval("date","{0:d}") %></ItemTemplate></asp:TemplateField><asp:BoundField DataField="reason" HeaderText="Reason" />
                            <asp:BoundField DataField="leave" HeaderText="Leave" />
                        </Columns>
                    </asp:GridView>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label3" runat="server" Text="Absent(not leave)" Visible="False"></asp:Label>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    <asp:GridView ID="GridView6" runat="server" AutoGenerateColumns="False">
                        <Columns>
                            <asp:BoundField DataField="student_name" HeaderText="Student name" />
                            <asp:TemplateField HeaderText="Date">
                            <ItemTemplate>
                            <%#Eval("date","{0:d}") %></ItemTemplate></asp:TemplateField><asp:BoundField DataField="reason" HeaderText="Reason" />
                        </Columns>
                    </asp:GridView>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
        <br />
    </asp:Panel>
    <p>
    </p>
    </asp:Content>

